<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
		
<a href="javascript:;" class=" btn-primary" style="width:30px;height:30px;position:fixed;right:20px;bottom:0px;padding:5px 5px 10px 5px;color:#ddd;display:none" id="up"><strong>回到顶部</strong></a>



<div class="navbar navbar-fixed-top " id="topbar">
			<div class="navbar-inner" >
				<div class="container" >
					<a class="brand" href="#" style="font-weight:bold">项目管理系统</a>
					<div class="nav-collapse">
						<ul class="nav pull-right">
							<li>
								<div><img src="downhead.jspx?pic=${employee.pic}" style=" height:30px;width:30px;margin-top:5px;border-radius:3px" /></div>
							</li>
							<li class="dropdown "id="caidan">
								<a data-toggle="dropdown" class="dropdown-toggle head-drop" href="javascript" style="color: #FFF;font-weight:bold">${sessionScope.employee.name}<b class="caret"></b></a>
								<ul class="dropdown-menu"style="margin-top:-1px">
									<li>
										<a href="#myModal" data-toggle="modal"><i class="icon-edit"></i>账户设置</a>
									</li>
									<li>
										<a href="head.jspx"><i class="icon-picture"></i>上传头像</a>
									</li>
									<li class="divider"></li>
									<li>
										<a href="quit.jspx"><i class="icon-off"></i>安全退出</a>
									</li>
								</ul>
							</li>
						</ul>
					</div>
				</div>
			</div>
</div>
<div class="modal fade" id="myModal">
	    <div class="modal-header">
	    	<a class="close" data-dismiss="modal">×</a>
	    <h3>账号设置</h3>
	    </div>
	    <div class="modal-body">
	   		<form class="form-horizontal">
	   			<div class="alert " id="alert-top" style="display:none;width:230px;margin-left:160px">
					<strong id="help-top"></strong><a class="close pull-right"id="close" href="#">X</a> 
				</div>
		        <fieldset>
		          <div class="control-group">
		            <label for="input01" class="control-label ">原始密码</label>
		            <div class="controls">
		              <input type="password" id="old" class="input-xlarge ">
		            </div>
		          </div>
		          <div class="control-group">
		            <label for="input01" class="control-label ">新密码</label>
		            <div class="controls">
		              <input type="password" id="newpwd" class="input-xlarge ">
		            </div>
		          </div>
		          <div class="control-group">
		            <label for="input01" class="control-label ">确认新密码</label>
		            <div class="controls">
		              <input type="password" id="renew" class="input-xlarge">
		            </div>
		          </div>
		        </fieldset>
		      </form>
	    </div>
	    <div class="modal-footer">
	    <a href="#" class="btn" data-dismiss="modal">返回</a>
	    <a href="#" class="btn btn-primary"id="btn-top">确认修改</a>
	    </div>
</div>
    
 
    <script type="text/javascript">
    	$(document).ready(function(){
    		$("#up").click(function(){
    			$(window).scrollTop(0);
    		});
    		
    	
    					$(window).scroll(function(){
							
							if($(window).scrollTop() > 50){
								
								$("#up").slideDown("fast");
							}else if($(window).scrollTop() < 50){
								$("#up").slideUp("fast");
							}
							
						});
						
    		
    		$("#caidan").hover(function(){
    			$("#caidan").addClass("open");
    		});
    		$("#caidan").mouseleave(function(){
    			$("#caidan").removeClass("open");
    		});
    		$("#close").click(function(){
    			$("#alert-top").hide(4000);
    		});
    		
    		$("#btn-top").click(function(){
	    		var old = $("#old").val();
	    		var newpwd = $("#newpwd").val();
	    		var renew = $("#renew").val();
    			if(old.trim() == "" || newpwd.trim() == "" || renew.trim() == ""){
    				$("#alert-top").addClass("alert-error").show();
    				$("#help-top").text("密码均不能为空！");
    			}else if(newpwd != renew){
    				$("#alert-top").addClass("alert-error").show();
    				$("#help-top").text("两次输入密码不一致！");
    				$("#newpwd").val("");
    				 $("#renew").val("");
    				
    			}else{
    				$.ajax({
    					url:"editpwd.jspx",
    					type:"POST",
    					data:{
    						old:old,
    						newpwd:newpwd
    					}
    				}).done(function(msg){
    					if(msg == 1){
    						$("#alert-top").removeClass("alert-error");
    						$("#alert-top").addClass("alert-success").show();
    						$("#help-top").text("密码修改成功！");
    						$("#newpwd").val("");
		    				 $("#renew").val("");
		    				 
    					}else{
    						$("#alert-top").addClass("alert-error").show();
    						$("#help-top").text("原密码错误！");
    					}
    					$("#old").val("");
    				});
    			}
    		});
    		
    	});
    </script>